<?php
/**
 * Created by PhpStorm.
 * Author: 芸签cms www.yunqiancms.com
 * User: sun
 * Date: 2022/6/27
 * Time: 4:12 PM
 */
namespace app\common\models;

class UserProfile extends BaseModel
{
    public $table = 'yq_user_profile';
    public $timestamps = true;
    protected $guarded = [''];
    public function departmentAdminUsers()
    {
        return $this->hasMany(DepartmentAdminUser::class,'uid','uid');
    }
    public static function getByUid($uid){
        return self::select()->where('uid',$uid)->first();
    }
    public  function atributeNames() {
        return [
            'realname'  => '姓名',
            'mobile'  => '电话',
        ];
    }

    public  function rules()
    {
        return [
            'realname' => 'required',
            'mobile'  => 'required',
        ];
    }
}